package com.moonciki.multids.multi;

import com.zaxxer.hikari.pool.HikariPool;
import lombok.extern.slf4j.Slf4j;

import javax.sql.DataSource;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.util.logging.Logger;

@Slf4j
public class FakeDataSource implements DataSource {

    @Override
    public Connection getConnection() throws SQLException {
        throw new SQLException("DataSource_name must be seted!");
    }

    @Override
    public Connection getConnection(String username, String password) throws SQLException {
        throw new SQLException("DataSource_name must be set!");
    }

    @Override
    public <T> T unwrap(Class<T> iface) throws SQLException {
        return null;
    }

    @Override
    public boolean isWrapperFor(Class<?> iface) throws SQLException {
        return false;
    }

    @Override
    public PrintWriter getLogWriter() throws SQLException {
        return null;
    }

    @Override
    public void setLogWriter(PrintWriter out) throws SQLException {

    }

    @Override
    public void setLoginTimeout(int seconds) throws SQLException {

    }

    @Override
    public int getLoginTimeout() throws SQLException {
        return 0;
    }

    @Override
    public Logger getParentLogger() throws SQLFeatureNotSupportedException {
        return null;
    }

    public void close() {
        log.info("FakeDataSource_call close ... ");
    }


}
